Index


RISC World

FontFiend

The complete manual for them most advanced Font Editor for RISC OS.

What is a font?

At its simplest form a font can be thought of as a collection of characters (not necessarily letters) that can be drawn at any size either on screen or to a printer. These characters are very similar in construction to draw files. They contain combinations of either straight lines, curved lines (called beziers) or move commands. The shapes that make up the characters in a font are filled with the required colour when they are drawn by the computer.

However a modern computer font actually consists of far more than just the characters, it also has details on the width of each character, its size and a host of other information. When a font is broken down into its constituent parts we find that a font is actually made up of a number of components. When these components are combined we have a full working font.

These components are best split up as follows:

  • Outlines & Composites (The drawings of the characters)
  • Skeletons & Scaffolds (Hinting)
  • Widths & Bounding boxes (sizes of the characters)
  • Kerning (adjustment to the widths in special circumstances)
  • Misc data

Acorn format fonts

Acorn fonts are actually made up of two files, one is called Outlines and the other Intmetrics. They are stored in sets of directories that mimic the font name.

For example : ADFS::4.$.!Fonts.iSVSans.Condensed.Outlines

The Outlines file contains the actual fonts outlines, as well as the skeletons, scaffolds and the bounding boxes.

The Intmetrics file contains the characters widths, another set of bounding boxes, optionally kerning data and the Misc data for the font. Intmetrics are stored as a separate file so the computer can quickly look at the size of a font and the space it will take up on screen without having to load the much more complex Outlines file.

Font Components

We have already explained that a font contains sets of drawings (called Outlines) as well as a number of other parts, but what are they and what do they do.

Outlines
These are the letter shapes that you actually see when a font is rendered. As explained earlier they are very similar to draw files. They are scaled up and down to the right size to plot the font correctly at a given point size. As you can see from the illustration on the left the outlines really consist of a set of points linked together by straight lines and curves.

FontFiend allows outlines to be constructed using the Draw application supplied with all Acorn computers. These can then be imported into the right character slot in the font.

Control Points
Acorn fonts have a slightly different format for the control points than PostScript fonts. Acorn format control points are located at 45 degrees, where as PostScript requires the control points to be at 90 degrees.

The two illustrations on the left show the difference. PostScript has its controls points at the horizontal and vertical extremities, but the Acorn font has them at 45 degrees.

FontFiend can operate with either type of control point. If however you ever intend using the font on any machine other than an Acorn you should use the PostScript control points in preference.

Bezier curves
The main type of join between points in a character is called a bezier curve. These are identical to the bezier curves used in Draw. They have a start point, an end point and two control points that can be moved around in order to change the shape of the curve.

Straight lines
Many characters in a font eg. H may be made entirely of straight lines, these are not the same as bezier curves. They have a start point and an end point, but they have no control points.

Moves
Outlines also contain move commands. These operate in the same way as the move tool in Draw. The current path (a collection of lines) is ended and a new path starts from another point. This allows you to make a single character that has more then one path. For example an O consists of two paths, one for the inside of the letter and one for the outside.

FontFiend supports a number of automatic operations that can be applied to outlines. FontFiend can even draw some of the outlines for your font automatically.

Design Size
The x,y position of control points in Acorn fonts are stored as 12 bit numbers in the range -2048 to +2048. The design size of the font is the number of these units that occupy 1 em. A font with a design size of 1000 has 1000 units (possible positions) per em. This means that the maximum size of a character can be 4096 (2048*2)/1000 ems, or 4.096 ems. Having a design size greater than 1000 can limit the size of characters. A design size of less than 1000 can have detrimental effects on the quality of a font since there may not be enough possible positions to draw outlines accurately.

Composites

Composite characters are characters that are made up of copies of the outlines from other characters. For example an accented letter such as � (ntilde) will be made up of two composite characters (n & tilde). Any change made to the outline of a character will effect any other characters that use the character as a composite.

If for example the shape of the letter n was changed, then the shape of � would also change, since this character is just a copy of two other characters superimposed on top of each other.

FontFiend allows you extensive control over composites, including converting them to real letters. If we converted � to a real letter and then changed character n then � would not change since it would no longer be a composite. Composites have a number of advantages, firstly using composites makes a font much smaller, secondly any changes made to the real letter will automatically affect any composites that use it.

Skeletons

Skeletons are drawn inside or around the character shapes (Outlines) to prevent any part of the character "dropping-out" at small sizes. They are usually placed inside parts of the outlines that are quite thin. In the example on the left you can see that the skeletons do not extend all the way around the letter C. Skeletons are generally needed inside curved parts of letters, or parts of the letter that are not completely vertical or horizontal. It is quite unusual to place skeletons inside an upper case H for example, as it just contains vertical and horizontal strokes. However if the H is very fine, or oblique, skeletons may be needed.

It is not entirely clear why skeletons are required. If the font manager ensured that it rendered one side of a stroke then skeletons would not be needed. PostScript fonts, for example, do not need skeletons to prevent drop outs. However as you can see from the two further illustrations on the left Acorn fonts definitely do need skeletons if they are to look good at very small sizes.

In short if you are designing a quality font you will need to include skeletons, but only in the very thin parts of your characters.

FontFiend incorporates a number of automatic skeleton options, see the appropriate section in the manual for more details.

If you have used FontED you may well be under the impression the outlines are filled shapes and skeletons are single lines inside the character. However, although FontED itself does not support it, skeletons can actually be complete paths and do not have to be inside the strokes of the character.

For example you could make a font that has no outlines, but has skeletons that make up the character shapes. This would result in a font that is rendered as a 1 pixel thick "open" font at any point size.

Widths

The widths specify how far the cursor, or caret, should move after a letter has been printed. If the width of a letter is not great enough then the next character printed will overlap. If the width is too great the next character will be too far away.

Setting up the correct widths for a font manually can be very time consuming. FontFiend allows you to set widths for characters up automatically based upon the size of the letter. FontFiend will also automatically set the widths for accented letters and any other letters or symbols it makes.

FontFiend will set widths using both mathematical models and an understanding of the font you are working on. Traditionally widths of a font are set manually by visually comparing letter gaps. FontFiend is very accurate when setting character widths, however it may be worth checking the results on complex script fonts.

Note: Some characters eg. accents, should have no width as they are only ever used in conjunction with another character. Please also note that the RISC OS 2 font manager can crash on some zero width characters in an unpredictable manner.

Widths are normally positive numbers specified in thousandths of an em. In theory widths can be negative as well as positive. However negative width characters can have an undesirable effect on many applications and we suggest that you stick with positive widths at all costs.

Scaffolds

Scaffolds and skeletons are often referred to as hinting. The characters scaffolds lock parts of the character together as well as locking the same parts of different characters together. On the left is the outline of character H with scaffolds applied, you can see how they match the shape of the letter. Below are two bitmaps, one with scaffolding applied, and one without. The difference is fairly obvious.

Scaffolds adjust the outlines of the character so that they always sit neatly on a pixel grid, if part of the letter goes below one pixel it will be adjusted so that it is exactly one pixel. Also similar parts of the letter are adjusted so that they are the same size.

Control points in both outlines and skeletons are attached to scaffolds.

The two main types of scaffold are "tangents" and "wide links", either of these can be vertical or horizontal and can either relate to one character (local) or to several characters (global). Tangents can also be either left or right, or top and bottom, this gives us a total of 12 different scaffold types. Scaffolds are used by the font manager to determine which parts of a character should be rendered and adjusted to the pixel grid. Control points attached to scaffold 1 will be adjusted first and then those attached to scaffold 2 and so on.

Wide links
These are the same type of scaffolds as we can see on the character H opposite. As you can see by placing two wide links, the same width apart, over the two stems of the H, the stems stay they same width when the font is rendered. Wide links are also used on the serifs to ensure that they appear. Wide links can either be horizontal or vertical, there are however a couple of restrictions on their use. They can only be a maximum of 253 design units in width, this can make scaffolding some fonts very tricky. Also they will only work correctly on rectangular objects, such as the stems on the H shown at the top of the page.

Tangent links
These are designed to prevent unsightly "pips" at the edges of round characters. They are usually used on characters like O or C. The example show character O with tangent links at all the edges. The two bit maps show the results of tangent links and not having tangent links.

Global scaffolds
Scaffolds can relate to a single character or to a range of characters. For example you could have a global scaffold across the top of all upper case letters to ensure that they have the same cap-height when rendered at small sizes. This scaffold would be defined in one upper case character and a copy if it appear in all the others. FontFiend automatically builds a scaffold tree when hinting a font.

Scaffold trees
A scaffold tree defines the way that global scaffolds are linked together inside a font. A scaffold may be defined in one character only, but appear in many others. If you delete the original scaffold then the tree will be corrupted and the font will no longer work. Global scaffolds propagate through the font in specific ways. If you look at a plan of this it looks as though the letters have grown like leaves on a tree.

Linear linking
This is a specialised form of linking. In the character E, for example, the centre scaffold would be linked between the top and bottom scaffold. This means that the position of the centre of the E will always remain the same in relation to the top and bottom of the character at any size.

X & Y Scaffolds
Scaffolds can be placed either horizontally or vertically. Those that are placed across the letter are the X scaffolds (since they move in the X axis). This may initially be confusing but with time will make sense. For example the scaffold across the centre stroke of an H is a Y scaffold, since it can move up or down (in the Y axis). The scaffolds that attach to the two vertical strokes of the H are X scaffolds since they can move left or right (in the X axis).

Connections
Scaffolds are linked to the control points that make up the outlines of a character. A scaffold can only work if it is connected to the right control points. FontFiend will automatically attach control points to scaffolds.

FontFiend supports automatic scaffolding of characters which means that in the vast majority of cases no manual editing will be required. FontFiend also links the scaffolds together itself so that no manual linking is needed.

Bounding Boxes

A bounding box literally defines the furthest parts of a character, it is the smallest possible rectangular box that can enclose the entire character. Bounding boxes are very important, if a font has faulty bounding boxes it will become very unreliable and cause "Font Cache Full" errors. Bounding boxes are stored in the file "Outlines" and optionally in the file called "Intmetrics".

FontFiend automatically recalculates bounding boxes after any change to a character or to a font so that the correct values are stored automatically. FontFiend also calculates the bounding boxes for any characters that are imported from Draw.

Note: If a font does have a corrupted bounding box then on loading it into FontFiend you should choose the "Bounding Recalculate" option and let FontFiend check all the bounding boxes and change then as necessary.

Global bounding boxes
A font also has a global bounding box, this is a box that can enclose any character in the font. You may sometimes find a font that works correctly for normal letters, but parts of the accents over accented letters do not get rendered correctly. This is because the fonts global bounding box is not big enough to enclose accented letters. You can recalculate the global founding box from the FontFiend global bounding box dialogue window.

Kerning

Kerning is stored in the "Intmetrics" part of a font. Kerning is the adjustment of gaps between letters. It allows the computer to alter the width of a letter (the amount the caret moves after printing the letter) depending on the next letter to be printed.

The illustrations on the left show the effect of kerning. In the first kerned pair the characters overlap slightly, but in the un-kerned pair they do not. Kerning can make a great deal of difference to the appearance of text when typeset using a particular font.

Kerning is defined as a pair of characters and an adjustment value. If this pair of characters is to be rendered the first character is drawn, then the position of the second character is moved by the adjustment value before that character is rendered.

Only Acorn RISC OS 3 (Version 8) fonts have kerning data, RISC OS 2 (Version 6) fonts do not. FontFiend loads and saves fonts with the kerning data intact. You can also edit any kern pairs present using the built in kerning editor.

Misc Data

This contains all sorts of interesting data about the font. Only RISC OS 3 fonts have a misc data area. If FontFiend finds a font without a misc data area then it will automatically construct the information in the area itself.

The misc data includes:

  • x-height of the font
  • Cap-height of the font
  • Descender & Ascender heights for the font etc

All of this information can be examined in the FontFiend misc data window.

The most interesting piece of information stored in this area are the offsets. The default X offset value specifies a standard width that is applied to all characters in addition to the width they have themselves. For example if you set all the widths in a font to zero and then set the default X offset to 1000 the caret would advance 1 em after every character was rendered, ie the font would be mono-spaced.

The misc data area also includes a default Y offset value. A font can easily be made that does not advance across the page when printed, but moves down the page. However most applications will get horribly confused if this is attempted.

The italic offset is used by FontFiend when building letters so that it can correctly position accented letters on a font that has a slope.

More details on the misc data area can be found in the chapter FontFiend main menu.

APDL and Foundation RISCWorld

 Index